<template>
  <div class="my-layout">
    <el-container>
      <el-aside style="width: auto;">
        <Menu :menu_key="menu_key" :is-collapse="menu_collapse"></Menu>
      </el-aside>
      <el-container>
        <el-header>
          <i class="el-icon-s-fold" v-show="menu_collapse===false" @click="menu_collapse=true"></i>
          <i class="el-icon-s-unfold" v-show="menu_collapse===true" @click="menu_collapse=false"></i>
        </el-header>
        <el-main>
          <slot></slot>
        </el-main>
        <el-footer>Footer</el-footer>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Menu from "@/components/Menu"

export default {
  props:["menu_key"],
  name: "MyLayout",
  components: {
    Menu
  },
  data(){
    return{
      menu_collapse:false
    }
  }
}
</script>

<style scoped>
.el-header, .el-footer {
  background-color: white;
  border: none;
  color: #333;
  line-height: 60px;
}
.el-header i{
  font-size: 30px;
  line-height: 60px;
}
.el-aside {
  background-color: #D3DCE6;
  color: #333;
  height: 100%;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;

}
.my-layout{
  height: 100%;
}
body > .el-container {
  margin-bottom: 40px;
  height: 100%;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>